home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Languages / Masm V6.11 / SAMPLES / DEMOS / DEMO.H$ / DEMO
Encoding:
Text File  |  1992-11-12  |  6.1 KB  |  138 lines

  1. /* Constants */
  2. #define CR 13                           /* ASCII code for ENTER  */
  3. #define ESCAPE 27                       /* ASCII code for ESC key */
  4. #define MDA 0                           /* Adapter constants      */
  5. #define CGA 1
  6. #define MCGA 2
  7. #define EGA 3
  8. #define VGA 4
  9. #define MONO 0                          /* Display constants      */
  10. #define COLOR 1
  11. #define clear_scrn( Attr, Row1, Row2 ) ClearBox( Attr, Row1, 0, Row2, 79 )
  12.  
  13. /* Structure members at 1-byte boundaries */
  14. #pragma pack( 1 )
  15.  
  16. /* Video configuration structure */
  17. struct VIDCONFIG
  18. {
  19.     unsigned char mode;         /* Current mode                   */
  20.     unsigned char dpage;        /* Current display page           */
  21.     unsigned char rows;         /* Number of display rows - 1     */
  22.     unsigned char cols;         /* Number of display columns      */
  23.     unsigned char display;      /* Either MONO or COLOR           */
  24.     unsigned char adapter;      /* Adapter code                   */
  25.     unsigned sgmnt;             /* Video segment with page offset */
  26. };
  27. struct VIDCONFIG pascal vconfig;  /* Structure for video configuration */
  28.  
  29. /* File information returned from FindFirst procedure  */
  30. struct FILEINFO
  31. {
  32.     char pad[21];               /* pad to 43 bytes     */
  33.     char attrib;                /* file attribute      */
  34.     unsigned time;              /* file time           */
  35.     unsigned date;              /* file date           */
  36.     long size;                  /* file size           */
  37.     char filename[13];          /* file name           */
  38. };
  39.  
  40. /* Disk statistics returned from GetDiskSize procedure */
  41. struct DISKSTAT
  42. {
  43.     unsigned total;             /* total clusters      */
  44.     unsigned avail;             /* available clusters  */
  45.     unsigned sects;             /* sectors per cluster */
  46.     unsigned bytes;             /* bytes per sector    */
  47. };
  48.  
  49. struct PARMBLK
  50. {
  51.     unsigned env;               /* segment of environment block         */
  52.     char _far *taddr;           /* segment:offset address of tail       */
  53.     char _far *fcb1;            /* segment:offset address of 1st FCB    */
  54.     char _far *fcb2;            /* segment:offset address of 2nd FCB    */
  55. };
  56.  
  57. /* Reset packing to default */
  58. #pragma pack()
  59.  
  60. /* Procedure prototypes from COMMON.ASM */
  61. short _pascal GetVer( void );
  62. void  _pascal GetVidConfig( void );
  63. void  _pascal StrWrite( unsigned Row, unsigned Col, char *Sptr );
  64. void  _pascal ClearBox( unsigned Attr, unsigned Row1, unsigned Col1,
  65.                         unsigned Row2, unsigned Col2 );
  66. void  _pascal DisableCga( void );
  67. void  _pascal EnableCga( void );
  68. void  _pascal SetCurPos( unsigned Row, unsigned Col );
  69. short _pascal GetCurPos( void );
  70. short _pascal StrInput( unsigned Row, unsigned Col,
  71.                         unsigned Max, char *Sptr );
  72.  
  73. /* Procedure prototypes from MISC.ASM */
  74. short    _pascal WinOpen( unsigned Row1, unsigned Col1,
  75.                           unsigned Row2, unsigned Col2, unsigned Attr );
  76. void     _pascal WinClose( unsigned Addr );
  77. void     _pascal SetCurSize( unsigned Scan1, unsigned Scan2 );
  78. unsigned _pascal GetCurSize( void );
  79. unsigned long _pascal GetShift( void );
  80. unsigned long _pascal GetMem( void );
  81. short    _pascal GetKeyClock( unsigned Row, unsigned Col );
  82. short    _pascal VeriAnsi( void );
  83. short    _pascal VeriPrint( void );
  84. short    _pascal VeriCop( void );
  85. short    _pascal SetLineMode( unsigned Line );
  86. void     _pascal Pause( unsigned Duration );
  87. void     _pascal Sound( unsigned Freq, unsigned Duration );
  88. void     _pascal WriteTTY( char *Sptr, unsigned icolor );
  89. void     _pascal Colors( unsigned Logic, unsigned Attr, unsigned Row1,
  90.                          unsigned Col1, unsigned Row2, unsigned Col2 );
  91. short    _pascal Exec( char *Spec, struct PARMBLK *Block,
  92.                        void *CtrBrk, void *CtrlC, void *Criterr );
  93. void     _pascal BinToHex( unsigned Num, char *Sptr );
  94.  
  95. /* Procedure prototypes from MATH.ASM */
  96. long     _pascal AddLong(  long Long1, long Long2 );
  97. long     _pascal SubLong(  long Long1, long Long2 );
  98. long     _pascal ImulLong( long Long1, long Long2 );
  99. unsigned long *_pascal MulLong( unsigned long Long1, unsigned long Long2 );
  100. short    _pascal IdivLong( long Long1, short Short2, short *Remn );
  101. unsigned _pascal DivLong(  unsigned long Long1,
  102.                            unsigned Short2, unsigned *Remn );
  103. short    _pascal Quadratic( float a, float b, float c,
  104.                             float *R1, float *R2 );
  105.  
  106. /* Procedure prototypes from FILE.ASM */
  107. void   _pascal ChangeDrive( unsigned Drive );
  108. void   _pascal GetDiskSize( unsigned Drive, struct DISKSTAT *Disk );
  109. void   _pascal SetDta( char far *Dta );
  110. void   _pascal GetDta( char far *Dta );
  111. short  _pascal ReadCharAttr( unsigned *Attr );
  112. short  _pascal GetCurDir( char *Spec );
  113. short  _pascal GetCurDrive( void );
  114. short  _pascal CopyFile( unsigned Imode, char *Fspec1, char *Fspec2 );
  115. short  _pascal DelFile( char *Fspec );
  116. short  _pascal MakeDir( char *Pspec );
  117. short  _pascal RemoveDir( char *Pspec );
  118. short  _pascal ChangeDir( char *Pspec );
  119. short  _pascal GetAttribute( char *Fspec );
  120. short  _pascal SetAttribute( unsigned Attr, char *Fspec );
  121. short  _pascal RenameFile( char *Fspec1, char *Fspec2 );
  122. short  _pascal GetFileTime( unsigned Handle, char *Sptr );
  123. short  _pascal FindFirst( unsigned Attr, char *Fspec,
  124.                           struct FILEINFO *Finfo );
  125. short  _pascal FindNext( struct FILEINFO *Finfo );
  126. short  _pascal UniqueFile( unsigned Attr, char *Pspec );
  127. short  _pascal OpenFile( unsigned Access, char *Fspec );
  128. void   _pascal CloseFile( unsigned Handle );
  129. short  _pascal CreateFile( unsigned Attr, char *Fspec );
  130. short  _pascal CreateNewFile( unsigned Attr, char *Fspec );
  131. short  _pascal ReadFile( unsigned Handle, unsigned Len, char *Pbuff );
  132. short  _pascal WriteFile( unsigned Handle, char *Sptr );
  133. void   _pascal Rewind( unsigned Handle );
  134. unsigned long _pascal GetFileSize( unsigned Handle );
  135. short  _pascal GetStr( char *Strbuf, unsigned Maxlen );
  136. char  *_pascal StrCompare( char *Sptr1, char *Sptr2, unsigned Len );
  137. char  *_pascal StrFindChar( char Ichar, char *Sptr, unsigned Direct );
  138.